#project origin directory
set origin_dir "."
#project name
set _xil_proj_name_ "GbitEthernet"
#create project
create_project ${_xil_proj_name_} ${origin_dir} -part xc7k325tffg676-2 -force

#1 add ip 

# set files [list \
#  [file normalize "../../01_ip/asyn_ram_18x1024/asyn_ram_18x1024.xci"]\
#  [file normalize "../../01_ip/axis_64bit_fifo/axis_64bit_fifo.xci"]\
#  [file normalize "../../01_ip/axis_dwidth_converter/axis_dwidth_converter.xci"]\
#  [file normalize "../../01_ip/blk_mem_rearr/blk_mem_rearr.xci"]\
#  [file normalize "../../01_ip/div_motor_period/div_motor_period.xci"]\
#  [file normalize "../../01_ip/fifo_pixel_active/fifo_pixel_active.xci"]\
#  [file normalize "../../01_ip/idelay_clk/idelay_clk.xci"]\
#  [file normalize "../../01_ip/ila_data/ila_data.xci"]\
#  [file normalize "../../01_ip/io_clk/io_clk.xci"]\
#  [file normalize "../../01_ip/matrix_mul/matrix_mul.xci"]\
#  [file normalize "../../01_ip/pid_mul/pid_mul.xci"]\
#  [file normalize "../../01_ip/pxl_line_buffer/pxl_line_buffer.xci"]\
#  [file normalize "../../01_ip/sensor_clk/sensor_clk.xci"]\
#  [file normalize "../../01_ip/signed_div_defocus/signed_div_defocus.xci"]\
#  [file normalize "../../01_ip/unsigned_div_centroid/unsigned_div_centroid.xci"]\
#  [file normalize "../../01_ip/unsigned_div_gbl_centroid/unsigned_div_gbl_centroid.xci"]\
#  [file normalize "../../01_ip/unsigned_mul_18X24/unsigned_mul_18X24.xci"]\
#  [file normalize "../../01_ip/unsigned_mul_32X16/unsigned_mul_32X16.xci"]\
#  [file normalize "../../01_ip/unsigned_mul_centroid/unsigned_mul_centroid.xci"]\
# ]

# add_files $files


#2 run block design tcl 
#source ../../02_bd/system_bd.tcl


#3 add rtl design files
# set files [list \
#  [file normalize "${origin_dir}/03_rtl/avmm/avmm_read_mux.sv"]\
#  [file normalize "${origin_dir}/03_rtl/avmm/avmm_read_pre_processing.sv"]\
#  [file normalize "${origin_dir}/03_rtl/centroid_process/centroid_cal.sv"]\
#  [file normalize "${origin_dir}/03_rtl/centroid_process/hy_centroid_process.sv"]\
#  [file normalize "${origin_dir}/03_rtl/centroid_process/line_defocus.sv"]\
#  [file normalize "${origin_dir}/03_rtl/centroid_process/line_gray_mul_hcnt.sv"]\
#  [file normalize "${origin_dir}/03_rtl/centroid_process/line_pxl_sum.sv"]\
#  [file normalize "${origin_dir}/03_rtl/defocus_process/defocus_freq_control.sv"]\
#  [file normalize "${origin_dir}/03_rtl/defocus_process/defocus_to_velocity.sv"]\
#  [file normalize "${origin_dir}/03_rtl/defocus_process/hy_defocus_process.sv"]\
#  [file normalize "${origin_dir}/03_rtl/defocus_process/pid_controller.sv"]\
#  [file normalize "${origin_dir}/03_rtl/defocus_process/pid_controller_serial.sv"]\
#  [file normalize "${origin_dir}/03_rtl/defocus_process/pid_controller_serial_add.sv"]\
#  [file normalize "${origin_dir}/03_rtl/dma/dma_data_formatter.sv"]\
#  [file normalize "${origin_dir}/03_rtl/dma/dma_data_gen.sv"]\
#  [file normalize "${origin_dir}/03_rtl/dma/dma_to_ps.sv"]\
#  [file normalize "${origin_dir}/03_rtl/general_ctrl/hy_freq_statistic.sv"]\
#  [file normalize "${origin_dir}/03_rtl/general_ctrl/hy_general_ctrl.sv"]\
#  [file normalize "${origin_dir}/03_rtl/image_preprocess/image_filter/campare_9data.sv"]\
#  [file normalize "${origin_dir}/03_rtl/image_preprocess/image_filter/image_filter_3x3.sv"]\
#  [file normalize "${origin_dir}/03_rtl/image_preprocess/image_filter/image_filter_3x3_top.sv"]\
#  [file normalize "${origin_dir}/03_rtl/image_preprocess/image_filter/line_buffer.sv"]\
#  [file normalize "${origin_dir}/03_rtl/image_preprocess/image_filter/sort_flow.sv"]\
#  [file normalize "${origin_dir}/03_rtl/image_preprocess/gray_threshold.sv"]\
#  [file normalize "${origin_dir}/03_rtl/image_preprocess/hy_image_preprocess.sv"]\
#  [file normalize "${origin_dir}/03_rtl/image_preprocess/image_filter.sv"]\
#  [file normalize "${origin_dir}/03_rtl/laser_control/hy_laser_control.sv"]\
#  [file normalize "${origin_dir}/03_rtl/laser_control/laser_auto_lightness.sv"]\
#  [file normalize "${origin_dir}/03_rtl/laser_control/laser_control.sv"]\
#  [file normalize "${origin_dir}/03_rtl/motor_ctrl/debouncer.sv"]\
#  [file normalize "${origin_dir}/03_rtl/motor_ctrl/hy_motor_system.sv"]\
#  [file normalize "${origin_dir}/03_rtl/motor_ctrl/motor_auto_execution.v"]\
#  [file normalize "${origin_dir}/03_rtl/motor_ctrl/motor_control.sv"]\
#  [file normalize "${origin_dir}/03_rtl/motor_ctrl/motor_manual_execution.v"]\
#  [file normalize "${origin_dir}/03_rtl/motor_ctrl/motor_period.sv"]\
#  [file normalize "${origin_dir}/03_rtl/motor_ctrl/motor_status.v"]\
#  [file normalize "${origin_dir}/03_rtl/osd/hy_osd_ctrl.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/sensor_spi/hy_sensor_spi.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/sensor_spi/sensor_spi_core.v"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/sensor_spi/spi_parameter_ctrl.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/TestPattern/test_pattern.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/TestPattern/test_pattern_core.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/des_8bit_to_adcdepth.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/fval_gen.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/hy_cmos_process.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/image_filter.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/image_rearr.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/image_rearr_rd.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/image_rearr_wr.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/iser2des_1_to_12.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/ob_correct.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/sensor_deserz_clk.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/sensor_expourse_ctrl.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/synn_code.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/synncode_core.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/train_word_align.sv"]\
#  [file normalize "${origin_dir}/03_rtl/sensor_ctrl/training.sv"]\
#  [file normalize "${origin_dir}/03_rtl/auto_focus_system.sv"]\
#  [file normalize "${origin_dir}/03_rtl/pkg_device_control.sv"]\
#  [file normalize "${origin_dir}/03_rtl/pkg_global.sv"]\
#  [file normalize "${origin_dir}/03_rtl/system_clk_generate.sv"]\
# ]

# add_files $files


# set top of design files
#set_property -name "top" -value "auto_focus_system" 
#set_property -name "top_auto_set" -value "0" 

#4 add simulation design files
#set files [list \
# [file normalize "${origin_dir}/04_sim/hy_defocus_process_tb.sv"]\
# [file normalize "${origin_dir}/04_sim/tb_defocus_freq_control.sv"]\
# [file normalize "${origin_dir}/04_sim/tb_defocus_process.sv"]\
# [file normalize "${origin_dir}/04_sim/tb_image_rx.sv"]\
# [file normalize "${origin_dir}/04_sim/tb_laser_control.sv"]\
# [file normalize "${origin_dir}/04_sim/tb_motor_control.sv"]\
# [file normalize "${origin_dir}/04_sim/tb_sensor_spi.sv"]\
#]
#add_files $files


#5 add constrs files
#set files [list \
# [file normalize "${origin_dir}/05_xdc/hardware_pins.xdc"]\
# [file normalize "${origin_dir}/05_xdc/hardware_timing.xdc"]\
#]
#add_files $files




